﻿using GrupFirmalarTahsilatGirisi;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TahsilatGirisi
{
    public partial class frmRehber : Form
    {
        public int rehberList;
        public string seciliAd = "";
        public string seciliKod = "";
        public int firmano;

        public frmRehber()
        {
            InitializeComponent();
            this.gridView1.KeyDown += gridView1_KeyDown;
        }

        void gridView1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode== Keys.Enter)
            {
                Sec();
            }
        }

        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            Sec();
        }

        private void Sec()
        {
            try
            {
                this.seciliKod = this.gridView1.GetRowCellValue(this.gridView1.GetSelectedRows()[0], "Kod").ToString();
                this.seciliAd = this.gridView1.GetRowCellValue(this.gridView1.GetSelectedRows()[0], "Ad").ToString();
                base.Close();
            }
            catch (Exception)
            {
            }
        }

        private void frmRehber_Load(object sender, EventArgs e)
        {
            this.gridControl1.DataSource = islemlerim.hesapGetir(this.rehberList, this.firmano.ToString());
            gridView1.BestFitColumns();
        }
    }
}
